package com.struct.graph.hall{
	/**
	 * 创建者：薛恒杰
	 * 工程名称：Marbles
	 * 创建时间：Aug 6, 2012 3:58:22 PM
	 * 类说明：HallGraphWorker.as,
	 */
	import com.collection.FactoryCollection;
	
	import flash.display.DisplayObjectContainer;
	import flash.events.MouseEvent;
	import flash.system.System;
	
	import sacu.s.worker.GraphWorker;
	
	public class HallGraphWorker extends GraphWorker{
		private var _base:Hall;
		public function HallGraphWorker(id:String, base:DisplayObjectContainer)
		{
			super(id, base);
			_base = base as Hall;
			_base.btnLogin.addEventListener(MouseEvent.CLICK, clickHandler);
			_base.btnQuit.addEventListener(MouseEvent.CLICK, clickHandler);
			_base.btnStart.addEventListener(MouseEvent.CLICK, clickHandler);
		}
		private function clickHandler(e:MouseEvent):void{
			switch(e.target){
				case _base.btnStart:{
					factory.disposeFactory();
					FactoryCollection.gs.startFactory();
					break;
				}
				case _base.btnLogin:{
					factory.disposeFactory();
					FactoryCollection.login.startFactory();
					break;
				}
				case _base.btnQuit:{
					System.exit(0);
					break;
				}
			}
		}
	}
}